<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>精彩视频列表</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" type="text/css" href="../../css/mui.min.css" />
		<style>
			*{
				padding: 0px;
				border: 0px;
				margin: 0px;
				font-family: "黑体";
			}
			#dv-serach{
				position: fixed;
				width: 100%;
				height: 50px;
				top: 10px;
				background-color: #fafafa;
			}
		</style>
	</head>
	<body style="background-color: white;">
		<div class="mui-content">
			<div id="dv-serach" style="">
				<input type="search" placeholder="Search" style="height: 40px; background-color: white; font-size: 17px;"/>
			</div>
			
			<div id="rfc-wondvidlst" class="mui-scroll-wrapper" style="height: 92%; top: 70px;">
				<div class="mui-scroll">
					
					<!--<div style="display: flex; margin: 10px 5px 10px 4px;">
                    	<div style="margin: 2px 5px 2px 5px; float: left;">
                    		<img src="../../img/1-13092PQ63K52.jpg" height="80" width="80" />
                    	</div>
                    	<div style="float: right; margin: 2px 0px 2px 10px; width: 80%;">
                    		<div style="color: #303030; font-size: 16px; width: 100%;">孩子不吃饭就该打一顿</div>
                    		<div style="margin-top: 30px; color: #303030; font-size: 14px; width: 100%;">
                    			<span style="float: left;"><img src="../../img/jzkt/yanjing_03.png" width="16"/>&nbsp;100</span>
                    			<span style="float: right; margin-right: 20px;">评论量：100</span>
                    		</div>
                    	</div>
                 	</div><hr style="width: 100%; background-color: #DCDCDC; height: 1px;" />
                 -->
                    
                    
					<div id="wondvidlst">

					</div>
				</div>
			</div>
		</div>
	</body>
	<script src="../../js/utils/http.utils.js"></script>
	<script src="../../js/mui.min.js"></script>
	<script>
		var $wxfwid = localStorage.getItem("wxfwid");
		mui.init({
			pullRefresh: {
				container: "#rfc-wondvidlst",
				up: {
					height: 20,
					auto: true,
					deceleration: 0.0006 ,
					contentrefresh : "加载中...",
					contentnomore:'没有更多数据了',
					callback: fun_loadUpGoodBooksLst
				}
			}
		});
		
		mui('#rfc-wondvidlst').on("tap", "a", function(){
			mui.openWindow({
				url : this.href
			});
		});
		
		var currPage = 0;
		
		function fun_loadUpGoodBooksLst(){
			fun_loadwdlstData(8, currPage);
		}
		
		function fun_loadWondVideoListTemHtml($vid, $num){
			var $wvhtml = 
			'<a id="artinfo" href="artDetailed.html?artid=' + $vid.id + '"><div style="display: flex; margin-top: 5px; margin-right: 8px;">'
			+	'<div style="width: 25%; margin: 4px;">'
			+		'<img src="' + $vid.thumbnail + '" style="width: 100%; height: 80px;" />'
			+	'</div>'
			+	'<div style="width: 75%; margin-left: 4px;">'
			+		'<span style="color: #303030; font-size: 15px; display: block;">'+ $vid.title +'</span>'
			+		'<span style="display: block; color: #616161; font-size: 13px; margin-top: 10px;">'+ $vid.contentAbstract +'</span>'
			+		'<span style=" display: block; color: #909090; font-size: 13px; float: right; margin-top:25px;"><img src="../../img/jzkt/yanjing_03.png" style="width: 16px;">&nbsp;'+ $vid.readCount +'</span>'
			+	'</div>'
			+'</div><a>'
			+'<hr style="width: 100%; background-color: #DCDCDC; height: 1px;" />';
			return $wvhtml;
		} 
		
		function fun_loadwdlstData($psize, $pcurr) {
			mui.ajax({
				url: $request_url.getWonderfulVideoLst,
				type: "get",
				headers: {
					"Authorization": $headers_authorization
				},
				data: {
					typeCode: "JCSP",
					recommend : "",
					orgId: $wxfwid,
					rows: $psize,
					page: $pcurr
				},
				dataType: "json",
				success: function(dat) {
					if(dat.code == 0) {
						var wdlstdiv = document.getElementById("wondvidlst");
						var $vdlst = dat.result
						if($vdlst != null && $vdlst.length > 0){
							mui("#rfc-wondvidlst").pullRefresh().endPullupToRefresh(false); // 加载数据最没有更多内容
							for(var i = 0; i < $vdlst.length; i++) {
								var $vdLi = document.createElement('div');
								$vdLi.innerHTML = fun_loadWondVideoListTemHtml($vdlst[i], i);
								wdlstdiv.appendChild($vdLi);
							}
							currPage ++;
						} else {
							mui("#rfc-wondvidlst").pullRefresh().endPullupToRefresh(true); // 加载数据最没有更多内容
						}
						
					}
				},
				error: function(err) {

				}
			});
		}
	</script>
</html>
